<?php

namespace App\Structs;

use App\Models\Order;
use App\Models\OrderItem;
use App\Models\Table;

class OrderBillItem
{
    /**
     * @var Table|null
     */
    public $table = null;

    /**
     * @var Order[]
     */
    public $orders = [];

    /**
     * @var OrderItem[]
     */
    public $items = [];

    public function getTotalMoney()
    {
        $totalMoney = 0;
        foreach ($this->orders as $order) {
//            if ($order->status->canPay())
//                $order->sumMoney();

            $totalMoney += $order->money;
        }

        return $totalMoney;
    }
}
